﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Ahi.Base
{
    public class FormParameter
    {
        public virtual string Name { get; set; }

        public object Value { get; set; }

        public virtual bool HasValue
        {
            get
            {
                return Value != null;
            }
        }

        public string ValueAsString
        {
            get
            {
                return ToString();
            }
        }

        public int ValueAsInt
        {
            get
            {
                if (Value.GetType() == typeof(int))
                    return (int)Value;
                return 0;
            }
        }

        public override string ToString()
        {
            if (Value != null)
                return Value.ToString();
            return string.Empty;
        }
    }
}
